home *** CD-ROM | disk | FTP | other *** search
- (*===========================================================================*)
- (* Monitor window write *)
- (* *)
- (* Copyright 1988, 1989 by H. Roy Engehausen. All rights reserved. *)
- (* This software may be freely distributed and used, but it may not *)
- (* under any circumstances be sold by anyone other than the author. *)
- (* It may be distributed by a commercial company as long as it is *)
- (* for no cost. *)
- (* *)
- (*===========================================================================*)
-
- (*===========================================================================*)
- (* Write data to monitor window *)
- (*===========================================================================*)
-
- PROCEDURE monitor_window_write(in_ptr : str_mixed_ptr;
- prefix_id : BOOLEAN;
- time_stamp : BOOLEAN);
-
- VAR
- i : WORD;
- p_str : STRING[9];
- save_color : BYTE;
-
- BEGIN;
-
- IF time_stamp THEN
- BEGIN;
- STR(today_time.sec:2, p_str);
- IF p_str[1] = ' ' THEN
- p_str[1] := '0';
- p_str := COPY(todays_date_time, 8, 4) + p_str + ':';
- END
- ELSE
- p_str := '';
-
- IF prefix_id THEN
- p_str := p_str + t_str;
-
- save_color := active_tcb^.w_color;
- active_tcb^.w_color := m_color;
-
- WITH in_ptr^ DO
- WHILE long_length > 0 DO
- BEGIN;
-
- IF long_length <= 255 THEN
- BEGIN;
- window_write(p_str, str_data);
- long_length := 0;
- str_data := '';
- active_tcb^.w_color := save_color;
- EXIT;
- END;
-
- i := 255;
-
- WHILE (i > 1) AND (str_data[i] <> cr) DO
- DEC(i);
-
- IF i < 2 THEN
- BEGIN;
- i := (80 * 3) - LENGTH(p_str);
- IF i > long_length THEN
- i := long_length;
- END;
-
- window_write(p_str, substr(str_data, 1, i-1));
-
- IF long_length <= (i + 1) THEN
- EXIT;
-
- in_ptr^ := l_substr(in_ptr, i +1, 0)^;
-
- p_str := '';
-
- END;
-
- active_tcb^.w_color := save_color;
-
- END;